//
//  MultiSegmentSplitView.h
//  MultiSegmentController
//
//  Created by ET|冰琳 on 16/5/24.
//  Copyright © 2016年 Binglin. All rights reserved.
//

#import <UIKit/UIKit.h>
#import "BIMultiSegmentControl.h"

@protocol MultiSegmentSplitViewDataSource <NSObject>

- (NSInteger)numberOfRowsInComponent:(NSInteger)component AtSegmentIndex:(NSInteger)segmentIndex;
- (void)didSelectAtSegmentIndex:(NSInteger)segmentIndex component:(NSInteger)component row:(NSInteger)row;

@optional
- (NSInteger)componentNumberAtSegmentIndex:(NSInteger)segmentIndex;

- (CGFloat)rowHeightInComponent:(NSInteger)component AtSegmentIndex:(NSInteger)segmentIndex;
- (CGFloat)widthForRowInComponent:(NSInteger)component AtSegmentIndex:(NSInteger)segmentIndex;
- (CGFloat)heightForSplitViewAtSegmentIndex:(NSInteger)segmentIndex;

- (NSString *)titleForCellAtSegmentIndex:(NSInteger)segmentIndex component:(NSInteger)component row:(NSInteger)row;
- (void)configurationCell:(UITableViewCell *)cell AtSegmentIndex:(NSInteger)segmentIndex component:(NSInteger)component row:(NSInteger)row;

- (BOOL)isSelectForCellAtSegmentIndex:(NSInteger)segmentIndex component:(NSInteger)component row:(NSInteger)row;
- (BOOL)shouldDismissAtSegmentIndex:(NSInteger)segmentIndex component:(NSInteger)component row:(NSInteger)row;



@end



/**
 所有展示的view均为SplitTableView
 */
@interface MultiSegmentSplitView : UIView

- (instancetype)initWithSegmentControl:(BIMultiSegmentControl *)control;

@property (nonatomic, readonly) BIMultiSegmentControl *segmentControl;

@property (nonatomic, assign) id<MultiSegmentSplitViewDataSource>  dataSource;

/**
 * Default YES 当drop 里的tableView选中时 默认将文本显示在segmentTitle中
 */
@property (nonatomic, assign) BOOL  changeSegmentTitleWhenSelectRow;

/**
 *  drop view显示的界面
 */
@property (nonatomic, assign) UIView  *dropContainer;

//手动调用隐藏显示出来的选项
- (void)hideSegmentSplitViews;

- (void)setSegmentTitle:(NSString *)title AtIndex:(NSInteger)index;

- (void)reloadViewAtSegmentIndex:(NSInteger)index;

@end
